/**
 * 
 */
package com.pmsco.pms.core.dao.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.pmsco.pms.core.dao.PmsSysInformationDao;
import com.pmsco.pms.core.domain.PmsSysInformation;

/**
 * @author Long Tran
 *
 */
public class PmsSysInformationDaoImpl extends HibernateDaoSupport implements PmsSysInformationDao {

	public void saveOrUpdatePmsSysInformation(PmsSysInformation pmsSysInformation) {
		getHibernateTemplate().merge(pmsSysInformation);
		getHibernateTemplate().flush();
	}

	public PmsSysInformation getPmsSysInformation() {
		PmsSysInformation ret = null;
		List<PmsSysInformation> temp = new ArrayList<PmsSysInformation>();
		PmsSysInformation searchTemplate = new PmsSysInformation();
		temp = getHibernateTemplate().findByExample(searchTemplate);
		if(temp != null && temp.size() == 1)
			ret = temp.get(0);
		return ret; 
	}
}
